﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="FishWeb.WebForm2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" language="javascript" src="Scripts/jquery-1.4.1.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
        <fieldset style="width: 400px; height: 200px;">
            <table cellpadding="3" cellspacing="3" border="0">
                <tr>
                    <td>
                        <asp:Label ID="lblName" Text="姓名: " runat="server"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" Width="200px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblAddress" Text="地址: " runat="server"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtAddress" Width="200px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblContact" Text="联系电话: " runat="server"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtContact" Width="200px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblEmail" Text="电子邮箱: " runat="server"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmail" Width="200px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button ID="btnSubmit" Text="提交" runat="server" />
                        <asp:Button ID="btnReset" Text="重置" runat="server" />
                    </td>
                </tr>
            </table>
        </fieldset>
    </div>
    <p>
    </p>
    <div align="left">
        <fieldset style="width: 400px; height: 150px">
            <p>
                请选择语言</p>
            <hr />
            <asp:CheckBox ID="chkSelectAll" runat="server" Text="全选" />
            <asp:CheckBoxList ID="ckbListPro" runat="server">
                <asp:ListItem Value="1" Text="C#"></asp:ListItem>
                <asp:ListItem Value="2" Text="JAVA"></asp:ListItem>
                <asp:ListItem Value="3" Text="C++"></asp:ListItem>
                <asp:ListItem Value="4" Text="JavaScript"></asp:ListItem>
            </asp:CheckBoxList>
        </fieldset>
        <br />
        <div id="message" style="color: Red;">
        </div>
    </div>
    <div align="center">
        <fieldset style="width: 400px; height: 80px;">
            <p>
                选择颜色：</p>
            <asp:DropDownList ID="ddlColor" runat="server">
                <asp:ListItem Text="--- 请选择 ---" Value=""></asp:ListItem>
                <asp:ListItem Text="红色" Value="1"></asp:ListItem>
                <asp:ListItem Text="黄色" Value="2"></asp:ListItem>
                <asp:ListItem Text="蓝色" Value="3"></asp:ListItem>
            </asp:DropDownList>
        </fieldset>
    </div>
    <br />
    </form>
</body>
<script type="text/javascript" language="javascript">
    jQuery(function () {
        jQuery("input:text:first").focus();
        jQuery("input:text").bind("keydown", function (e) {
            if (e.which == 13) {
                e.preventDefault();
                var nextIndex = jQuery("input:text").index(this) + 1;
                if (nextIndex < jQuery("input:text").length) {
                    jQuery("input:text")[nextIndex].focus();
                }
            }
        });
    });

    jQuery("#<%=btnReset.ClientID %>").click(function () {

        jQuery("form")[0].reset();
    });


    jQuery(document).ready(function () {
        jQuery("#<%=ckbListPro.ClientID %>").click(function () {
            var str = "";
            jQuery("#<%=ckbListPro.ClientID %> input[type=checkbox]:checked").each(function () {
                str = str + jQuery(this).val() + ":" + jQuery(this).next().text();
                jQuery("#message").html(str);
            });

        });
    });

    jQuery(document).ready(function () {

        jQuery("#<%=chkSelectAll.ClientID %>").bind("click", function () {
            alert("20:13");
            jQuery("#<%=ckbListPro.ClientID %> input[type=checkbox]")
            .attr("checked", jQuery("#<%=chkSelectAll.ClientID%>").is(":checked"));
        });
    });

</script>
</html>
